Beyond the Guilt Trip: How CarbonCompass Uses AI Architecture to Localize and Humanize Carbon Tracking

Main Facts: The Structural Failure of Modern Carbon Apps

In the rapidly expanding landscape of climate technology, carbon footprint trackers have long suffered from a quiet but pervasive user-retention crisis. The typical user journey for popular applications like Klima, Capture, and JouleBug follows a predictable, discouraging path: the user completes an onboarding quiz, receives a daunting estimate of their weekly carbon dioxide emissions (e.g., "Your footprint is 120 kg $CO_2$/week"), is presented with a list of generic eco-tips, and subsequently abandons the application.

Industry analysts refer to this phenomenon as the "eco-guilt loop"—a design pattern that informs users of their environmental shortcomings without providing realistic, structured guidance to improve.

To address this systemic engagement failure, developer Mithun Visvesh designed and built CarbonCompass, an interactive, persona-driven carbon coaching application. Created as an entry for Challenge 3 (Carbon Footprint Awareness & Reduction) of the PromptWars Virtual Hackathon, CarbonCompass rejects the one-size-fits-all model of environmental accounting. Instead, the application shifts the focus from passive measurement to dynamic, highly localized behavioral coaching.

Traditional Apps:  Quiz ──> "Your footprint is 120kg" ──> Generic Tips ──> User Abandons
CarbonCompass:     Quiz ──> Shared Calc Engine ──> Persona-Tailored AI Coaching + Live Simulator

The core innovation of CarbonCompass lies in its recognition that carbon reduction strategies are deeply tied to socio-economic realities. Most mainstream carbon calculators recommend high-capital interventions such as installing solar panels, purchasing electric vehicles (EVs), or transitioning to strict vegan diets. While scientifically sound, these recommendations are functionally useless for demographics lacking financial liquidity or residential autonomy.

To prove the efficacy of localized, context-aware coaching, CarbonCompass was designed around two distinct, real-world Indian user personas:

Persona A: Aditi (The Resource-Constrained Student)

  • Location: Chennai
  • Lifestyle: Commutes via public transit (bus), resides in a college hostel, dines at the shared mess hall, and shares electricity usage with roommates.
  • Primary Carbon Lever: Food waste management. Because her transit emissions are already minimized and her energy use is shared, urging her to buy an EV or install solar panels is irrelevant. Her most actionable reduction path lies in reducing daily food waste.

Persona B: Rohan (The Urban Tech Professional)

  • Location: Bengaluru
  • Lifestyle: Commutes via a personal petrol car and scooter, resides in an air-conditioned two-bedroom apartment, and frequently orders food delivery.
  • Primary Carbon Lever: Domestic energy efficiency and transit consolidation. His lifestyle offers significant opportunities for carbon reduction through smart home climate control and transit substitution, rather than dietary adjustments.

By processing these diverse profiles through a unified mathematical engine and an interpretive artificial intelligence layer, CarbonCompass delivers personalized, high-impact behavioral interventions tailored to each user’s unique socio-economic context.


Chronology: Building CarbonCompass with Agentic AI

The development of CarbonCompass provides a compelling case study in modern, AI-assisted software engineering. Rather than writing code manually from the outset, Visvesh utilized Google Antigravity, an experimental AI-driven development environment, to architect, build, test, and deploy the application on a compressed hackathon timeline.

[Phase 1: Architecture] ──> Run Antigravity "Plan Mode" ──> Review & Approve Implementation Plan
                                                                   │
[Phase 2: Core Engine]  ──> Write carbonCalculator.js <────────────┘
                                  │
                                  v
                            Verify via verifyCalculator.js (100% Match)
                                  │
                                  v
[Phase 3: UI & AI]      ──> Build UI Components (React 19 / Tailwind)
                            Integrate Gemini 2.0 Flash (AI Habit Coach)
                                  │
                                  v
[Phase 4: Deployment]   ──> Automated Browser Testing & Vercel Deployment

Phase 1: Architectural Planning and Guardrails

Before generating a single line of code, Visvesh initialized Google Antigravity in Plan Mode. He prompted the AI agent as a Senior Product Architect, instructing it to analyze the product requirements and generate a comprehensive "Implementation Plan" artifact before writing any source code.

This plan established a critical architectural constraint: the creation of a single, centralized calculation engine (carbonCalculator.js) to serve as the absolute source of truth across all application layers. This design choice prevented a common bug in environmental software, where the dashboard, the impact simulator, and the AI coach display conflicting carbon metrics due to duplicated or fragmented calculation logic.

Phase 2: Engine Development and Empirical Verification

Once the Implementation Plan was approved, the developer generated the shared calculation engine. To ensure absolute mathematical integrity, Visvesh wrote a dedicated validation script, verifyCalculator.js. This script cross-referenced the automated outputs of the calculation engine against manually calculated, expected values for both the "Aditi" and "Rohan" personas. The engine passed this verification phase with a 100% match, establishing a reliable, deterministic foundation for the user interface.

Phase 3: Building the Interface and Integrating the AI Coach

With the mathematical foundation validated, the developer utilized Antigravity to build the front-end user interface using React 19, Vite, and Tailwind CSS.

For minor UI adjustments—such as modifying color schemes, refining CSS layouts, or changing button labels—Visvesh switched the AI agent to Fast Mode, which bypasses the planning phase to execute immediate code edits.

Simultaneously, the AI Habit Coach was integrated into the application, powered by Google’s Gemini 2.0 Flash model. The model was deployed via a secure serverless proxy on Vercel (api/gemini.js) to protect API credentials.

Phase 4: Automated Testing and Deployment

In the final phase of development, the Google Antigravity agent executed end-to-end user flow testing. The agent launched an automated browser instance, clicked through the onboarding sequence, loaded the pre-configured personas, verified the responsive behavior of the impact simulator, took interface screenshots, and compiled a final "Walkthrough" verification artifact. The production-ready application was then deployed directly to Vercel.


Supporting Data: The Mathematical and Methodological Framework

To maintain scientific credibility, CarbonCompass relies on a fully transparent, deterministic calculation engine. The system completely separates quantitative math from qualitative AI interpretation.

                       ┌────────────────────────┐
                       │  User Inputs (Weekly)  │
                       └───────────┬────────────┘
                                   │
                                   v
                    ┌──────────────────────────────┐
                    │     carbonCalculator.js      │
                    │  (Deterministic Math Engine) │
                    └──────────────┬───────────────┘
                                   │
         ┌─────────────────────────┼─────────────────────────┐
         │                         │                         │
         v                         v                         v
┌─────────────────┐       ┌─────────────────┐       ┌─────────────────┐
│    Dashboard    │       │ Impact Simulator│       │  AI Habit Coach │
│ (Current State) │       │ (What-If Sliders)│       │ (Interpretation)│
└─────────────────┘       └─────────────────┘       └─────────────────┘

The application aggregates data across four primary categories: transport, home energy, diet, and food waste.

The Mathematical Formula

The total weekly carbon footprint ($W$) is expressed as the sum of its constituent categories, measured in kilograms of carbon dioxide equivalent ($kg CO_2e$):

$$W = T + E + D + F$$

Where:

  • $T$ (Transport Emissions):
    $$T = fracsum (textDistancetextkm/week times textEmission Factortextg CO_2/textkm)1000$$
  • $E$ (Energy Emissions):
    $$E = (textElectricitytextkWh/week times 0.75) + left(fractextLPG Cylinderstextmonth4.33 times 42.0right)$$
  • $D$ (Dietary Emissions):
    $$D = textDaily Factor_textkg CO_2texte/day times 7$$
  • $F$ (Food Waste Emissions):
    $$F = textFood Wasted_textkg/week times 2.5$$

Sourced Emission Factors

The application’s calculation engine utilizes a single, documented object containing verified, sourced emission factors:

Category Sub-Category Value Unit Primary Data Source
Electricity Grid Power 0.75 $kg CO_2/kWh$ Central Electricity Authority (CEA) Baseline Database, India
LPG Household Cylinder 42.0 $kg CO_2/textcylinder$ Indian Domestic LPG Consumption Metrics
Transport Petrol Car 150.0 $g CO_2/km$ CarbonCrux Indian Fleet Mix Study
Transport Public Bus 89.0 $g CO_2/textpassenger-km$ Department for Environment, Food & Rural Affairs (Defra) Proxy
Transport Cycling 33.0 $g CO_2/km$ Our World in Data Lifecycle Assessment
Diet High Meat 7.19 $kg CO_2e/day$ Scarborough et al. (2014) Dietary Study
Diet Vegetarian 3.81 $kg CO_2e/day$ Scarborough et al. (2014) Dietary Study
Diet Vegan 2.89 $kg CO_2e/day$ Scarborough et al. (2014) Dietary Study
Food Waste General Food 2.5 $kg CO_2/kg textwaste$ Poore & Nemecek (2018) Science Meta-Analysis

Technical Implementations: AI Guardrails and the Impact Simulator

The AI Layer: Interpretation, Not Calculation

A common failure state in AI-enabled environmental applications is "mathematical hallucination," where large language models (LLMs) attempt to compute emissions calculations dynamically and return inconsistent or mathematically impossible values.

To eliminate this vulnerability, CarbonCompass implements strict architectural guardrails. The Gemini 2.0 Flash model is strictly barred from performing mathematical operations. Instead, it functions purely as an interpretive coach.

The serverless backend proxy passes the pre-calculated outputs of carbonCalculator.js to the Gemini API, accompanied by a highly restrictive system prompt:

// System Prompt Guardrails for Gemini 2.0 Flash
const SYSTEM_PROMPT = `
You are CarbonCompass's AI Habit Coach. 
You have been provided with the user's ALREADY CALCULATED weekly carbon footprint breakdown.

CRITICAL RULES:
1. NEVER calculate or recalculate the carbon footprint. Use the provided numbers as absolute truth.
2. If the user asks "what if" questions, direct them to use the interactive Impact Simulator. Do not estimate math.
3. Focus exclusively on realistic, low-cost, behavioral habit changes.
4. Ensure recommendations match the user's socio-economic profile (e.g., do not suggest solar panels to students).
`;

By enforcing this clear separation of concerns, CarbonCompass ensures that the qualitative advice provided by the AI is always aligned with the hard data displayed on the dashboard.

The Impact Simulator: Instant, Deterministic Feedback

To drive user engagement, CarbonCompass features an interactive, client-side Impact Simulator. This component allows users to adjust real-time sliders—representing daily habits, such as swapping two bus commutes for bicycle trips—and observe the immediate, simulated impact on their carbon footprint.

Because the simulator calls the exact same calculateWeeklyFootprint() function within carbonCalculator.js using local state variables, it operates with zero API latency and zero chance of logical drift.

[User Adjusts Slider] ──> [Local State Updates] ──> [calculateWeeklyFootprint()] ──> [UI Re-renders Instantly]

When a user adjusts a slider, the UI instantly renders a dynamic delta badge (e.g., -8% Carbon) and a contextual equivalent card (e.g., "Equivalent to planting 19 trees"), offering immediate positive reinforcement.


Official Context and Hackathon Evaluation

The development of CarbonCompass was driven by the specific, rigorous evaluation criteria of the PromptWars Virtual Hackathon (Challenge 3). Hackathon judges, typically composed of senior software engineers, product architects, and technology investors, evaluate submissions on technical execution, architectural soundness, and real-world viability.

In software evaluation, transparency is often valued over false precision. Visvesh proactively addressed data limitations by building a dedicated Methodology & Sources page directly into the application.

For instance, the application explicitly notes that while its transport and energy factors are tailored to the Indian grid and fleet mix, its dietary lifecycle data is derived from UK research (Scarborough et al., 2014). This data serves as a comparative proxy for urban Indian dietary habits rather than an exact measure.

This level of methodological honesty builds credibility with technical judges, who are naturally skeptical of consumer-facing carbon calculators that claim absolute precision without disclosing their underlying datasets or regional assumptions.


Implications: The Future of AI Coding and Micro-Climate Action

The successful deployment of CarbonCompass highlights two significant shifts in technology: the evolution of software development and the future of consumer climate action.

The Paradigm Shift in Software Engineering

The development workflow of CarbonCompass demonstrates how agentic AI platforms, like Google Antigravity, are redefining the role of the software engineer. By utilizing "Plan Mode," the developer transitioned from a traditional programmer writing syntax to an architect and editor.

Traditional Development:  Specs ──> Manual Coding ──> Manual Testing ──> Debugging Loop
Agentic AI Development:   Specs ──> Plan Review   ──> Agentic Coding ──> Automated Walkthrough

The AI agent handled the routine work of generating boilerplate components, writing basic CSS, and running automated tests. This allowed the human developer to focus on high-value tasks:

  • Verifying architectural constraints (preventing duplicate calculation engines).
  • Designing strict system prompts to prevent AI hallucinations.
  • Reviewing and annotating implementation plans before code generation.

This collaborative approach significantly reduces development cycles, allowing complex, production-ready applications to be built and verified in days rather than weeks.

Localized Micro-Climate Action

At the product level, CarbonCompass proves that effective environmental tools must meet users where they are. By showing that minor behavioral changes—like minimizing food waste for a hostel student or consolidating vehicle trips for an urban professional—can lead to measurable carbon reductions, the application replaces overwhelming eco-anxiety with practical, daily agency.

The Future Roadmap

To transition CarbonCompass from a successful hackathon project into a scalable consumer platform, Visvesh has outlined several key technical enhancements:

  • Persistent Data Layer: Integrating Supabase to replace local storage, enabling users to track their progress over time and sync data across multiple devices.
  • Social Proof & Shareability: Implementing a "My Carbon Card" feature, allowing users to export their customized dashboard metrics into clean, visual graphics for sharing on LinkedIn or WhatsApp.
  • Localized Lifecycle Data: Partnering with regional agricultural institutions to replace Western dietary proxies with direct, Indian-specific food lifecycle carbon data.
  • Behavior Verification: Developing an incentive-aligned verification layer that uses photo uploads or location check-ins to confirm when users successfully complete their weekly carbon reduction challenges.

By combining rigorous software architecture with highly personalized, context-aware coaching, CarbonCompass offers a practical blueprint for the next generation of climate technology. It moves past generic guilt trips, pointing the way toward effective, daily carbon reduction.